import request from '../utils/Request';

const bookApi={
    // 条件查询带分页
    selectByCondition(pageNo,pageSize,searchBook){
        return request({
            url:'/book/loadList',
            method:'post',
            params:{
                pageNo,
                pageSize,
            },
            data:searchBook
        })
    },
    selectAllAuthor(){
        return request({
            url:'/author/getAllAuthor',
            method:'get',
        })
    },
    addBook(book){
        return request({
            url:'/book/addBook',
            method:'post',
            data:book
        })
    },
    updateBook(book){
        return request({
            url:'/book/updateBook',
            method:'put',
            data:book
        })
    },
    deleteById(id){
        return request({
            url:`/book/deleteBook`,
            method:'delete',
            data:id
        })
    },
}


export default bookApi
